/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package logica.cliente;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.cliente.Cliente;
import model.cliente.ClienteDAO;

/**
 *
 * @author davi
 */
public class EditaCliente implements logica.Logica{

    @Override
    public void executa(HttpServletRequest req, HttpServletResponse res) throws Exception {
        
       String id = req.getParameter("id".trim());
        
        ClienteDAO dao = new ClienteDAO();
        
        Cliente cliente = dao.buscaClienteDetalhes(id);
        
        req.setAttribute("cliente", cliente);
        
        RequestDispatcher rd = req.getRequestDispatcher("editaCliente.jsp");
        rd.forward(req, res);
        
        
    }
    
}
